//TOWN SCRIPT TEMPLATE

begintownscript;

variables;
string dlgstr;

body;

beginstate INIT_STATE;
	set_crime_tolerance(1);

	march_party(28,16);
	march_party(27,16);
	march_party(26,16);
	march_party(25,16);
	force_view_center(25,16);
	force_instant_terrain_redraw();

	message_dialog("You proceed down the road to the nearest town, ready to rest in a proper bed for the first time in days. Your companions provide encouraging words.","");

	text_bubble_on_char(2,"Are we there yet?");
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(24,16);
	force_view_center(24,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(23,16);
	force_view_center(23,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	clear_buffer();
	append_char_name(1);
	append_string(" tired.");
	get_buffer_text(dlgstr);

	march_party(22,16);
	force_view_center(22,16);
	text_bubble_on_char(2,"");
	text_bubble_on_char(1,dlgstr);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(21,16);
	force_view_center(21,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(20,16);
	force_view_center(20,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(19,16);
	force_view_center(19,16);
	text_bubble_on_char(1,"");
	text_bubble_on_char(3,"As our articulate friend has noted,");
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(18,16);
	force_view_center(18,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(17,16);
	force_view_center(17,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(16,16);
	force_view_center(16,16);
	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"we need rest. Are you planning...");
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(15,16);
	force_view_center(15,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	march_party(14,16);
	force_view_center(14,16);
	force_instant_terrain_redraw();
	pause(2 * get_flag(290,0));

	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();
	activate_hidden_group(1);
	put_boom_on_char(6,6,0);
	run_animation_sound(54);

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"Woah!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(6,"Silence, mortals!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"I am the messenger");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"of Perapus the Archmage!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"Tremble before me!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	force_instant_terrain_redraw();

	message_dialog("The skeletal creature rasps in threatening tones at you. _Beware, adventurers who seek the treasure of the archmage! You are known to him, and he is watching._","Something about this seems off, but the lich continues. _Yea, for the master is great and powerful beyond compare, and..._");
	
	text_bubble_on_char(3,"Bored now.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(6,"Excuse me?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(3,"I said I'm bored!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"I'm too tired to listen to you");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"rambling on about your master.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"I need to get to an inn, snappy!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();

	message_dialog("The lich does not seem to like this.","");

	text_bubble_on_char(6,"Watch your tone, Michael, or I will...");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(3,"Wait, what did you call me?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(6,"Michael!");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"Are you not the party of");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"Jenneke, Thissa, Frrrrrr,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"Adrianna, Feodoric, and Michael?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(3,"In case you can't count, skull-brain,");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"you just named SIX people.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"There are FOUR of us.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();

	message_dialog("The lich quickly pulls a piece of paper out of his tattered robes and scans it over, mumbling to himself. _At the entrance to the valley, yes, right place, right time, a rag-tag band of newbie adventurers, check, all good. Six adventurers. Nope._","He looks up.");

	text_bubble_on_char(6,"I think I have the wrong group.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"What were the odds");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"that TWO parties were going to enter");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"this area at the same time?");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"Never mind. Carry on.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	text_bubble_on_char(6,"My bad.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(6,"");
	force_instant_terrain_redraw();
	
	put_boom_on_char(6,6,0);
	run_animation_sound(54);
	erase_char(6);
	force_instant_terrain_redraw();

	text_bubble_on_char(3,"I'm not sure whether to be relieved...");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	text_bubble_on_char(3,"or insulted.");
	force_instant_terrain_redraw();
	pause(5 * get_flag(290,0));

	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();

break;

beginstate EXIT_STATE;
//called when the party leaves the town
	set_town_visibility(7,0);
	text_bubble_on_char(0,"");
	text_bubble_on_char(1,"");
	text_bubble_on_char(2,"");
	text_bubble_on_char(3,"");
break;

beginstate START_STATE;
//called every turn when the party is in the town

break;